package com.dragon.modules.yuegou.query.order;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dragon.modules.yuegou.entity.order.PrintEntity;
import com.dragon.modules.yuegou.enums.order.PrintType;
import com.dragon.modules.yuegou.mybatis.Condition;
import com.dragon.modules.yuegou.mybatis.Query;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonUnwrapped;

import java.time.LocalDateTime;

/**
 * 订单打印 动态查询条件
 * 
 * @author pbuilder generated
 * @date 2020-06-03 13:42:08
 * @version 2.0
 */
@JsonInclude(Include.NON_NULL)
public class PrintQuery extends PrintEntity implements Query<PrintEntity> {

    /** 订单号查询条件 */
	@JsonUnwrapped(prefix = "orderNo")
	private Condition<String> orderNoCondition;

    /** 商户id查询条件 */
	@JsonUnwrapped(prefix = "merchantId")
	private Condition<String> merchantIdCondition;

    /** [枚举]订单类型：0-到家订单-GOHOME、1-聚合支付订单-AGGREPAY查询条件 */
	@JsonUnwrapped(prefix = "type")
	private Condition<PrintType> typeCondition;

    /** 是否打印 0 未打印 1 打印查询条件 */
	@JsonUnwrapped(prefix = "printStatus")
	private Condition<Boolean> printStatusCondition;

    /** 最后打印时间查询条件 */
	@JsonUnwrapped(prefix = "lastPrintTime")
	private Condition<LocalDateTime> lastPrintTimeCondition;

	/**
	 * 构造一个查询条件对象
	 */
	public PrintQuery() {
		super();
	}

	/**
	 * 依据实体对象构造一个查询条件对象
	 * 
	 * @param entity 实体对象
	 */
	public PrintQuery(PrintEntity entity) {
		super(entity);
	}

	/**
	 * 依据其它查询条件对象的信息构造一个查询条件对象
	 * 
	 * @param other 查询条件对象
	 */
	public PrintQuery(PrintQuery other) {
		super(other);
		if(other.orderNoCondition != null) {
			this.orderNoCondition = other.orderNoCondition.copy();
		}
		if(other.merchantIdCondition != null) {
			this.merchantIdCondition = other.merchantIdCondition.copy();
		}
		if(other.typeCondition != null) {
			this.typeCondition = other.typeCondition.copy();
		}
		if(other.printStatusCondition != null) {
			this.printStatusCondition = other.printStatusCondition.copy();
		}
		if(other.lastPrintTimeCondition != null) {
			this.lastPrintTimeCondition = other.lastPrintTimeCondition.copy();
		}
	}

	@Override
	public QueryWrapper<PrintEntity> toQueryWrapper() {
		QueryWrapper<PrintEntity> wrapper = new QueryWrapper<>(this);
		if (orderNoCondition != null) {
			orderNoCondition.toWrapper(wrapper, COL_ORDER_NO);
		}
		if (merchantIdCondition != null) {
			merchantIdCondition.toWrapper(wrapper, COL_MERCHANT_ID);
		}
		if (typeCondition != null) {
			typeCondition.toWrapper(wrapper, COL_TYPE);
		}
		if (printStatusCondition != null) {
			printStatusCondition.toWrapper(wrapper, COL_PRINT_STATUS);
		}
		if (lastPrintTimeCondition != null) {
			lastPrintTimeCondition.toWrapper(wrapper, COL_LAST_PRINT_TIME);
		}
		return wrapper;
	}

	/**
	 * 构造并返回订单号查询条件
	 * 
	 * @return orderNoCondition 订单号查询条件
	 */
	public Condition<String> orderNo() {
		this.orderNoCondition = new Condition<>();
		return this.orderNoCondition;
	}
	
	/**
	 * 获取订单号查询条件
	 * 
	 * @return orderNoCondition 订单号查询条件
	 */
	public Condition<String> getOrderNoCondition() {
		return orderNoCondition;
	}

	/**
	 * 设置订单号查询条件
	 * 
	 * @param orderNoCondition 订单号查询条件
	 */
	public void setOrderNoCondition(Condition<String> orderNoCondition) {
		this.orderNoCondition = orderNoCondition;
	}

	/**
	 * 构造并返回商户id查询条件
	 * 
	 * @return merchantIdCondition 商户id查询条件
	 */
	public Condition<String> merchantId() {
		this.merchantIdCondition = new Condition<>();
		return this.merchantIdCondition;
	}
	
	/**
	 * 获取商户id查询条件
	 * 
	 * @return merchantIdCondition 商户id查询条件
	 */
	public Condition<String> getMerchantIdCondition() {
		return merchantIdCondition;
	}

	/**
	 * 设置商户id查询条件
	 * 
	 * @param merchantIdCondition 商户id查询条件
	 */
	public void setMerchantIdCondition(Condition<String> merchantIdCondition) {
		this.merchantIdCondition = merchantIdCondition;
	}

	/**
	 * 构造并返回[枚举]订单类型：0-到家订单-GOHOME、1-聚合支付订单-AGGREPAY查询条件
	 * 
	 * @return typeCondition [枚举]订单类型：0-到家订单-GOHOME、1-聚合支付订单-AGGREPAY查询条件
	 */
	public Condition<PrintType> type() {
		this.typeCondition = new Condition<>();
		return this.typeCondition;
	}
	
	/**
	 * 获取[枚举]订单类型：0-到家订单-GOHOME、1-聚合支付订单-AGGREPAY查询条件
	 * 
	 * @return typeCondition [枚举]订单类型：0-到家订单-GOHOME、1-聚合支付订单-AGGREPAY查询条件
	 */
	public Condition<PrintType> getTypeCondition() {
		return typeCondition;
	}

	/**
	 * 设置[枚举]订单类型：0-到家订单-GOHOME、1-聚合支付订单-AGGREPAY查询条件
	 * 
	 * @param typeCondition [枚举]订单类型：0-到家订单-GOHOME、1-聚合支付订单-AGGREPAY查询条件
	 */
	public void setTypeCondition(Condition<PrintType> typeCondition) {
		this.typeCondition = typeCondition;
	}

	/**
	 * 构造并返回是否打印 0 未打印 1 打印查询条件
	 * 
	 * @return printStatusCondition 是否打印 0 未打印 1 打印查询条件
	 */
	public Condition<Boolean> printStatus() {
		this.printStatusCondition = new Condition<>();
		return this.printStatusCondition;
	}
	
	/**
	 * 获取是否打印 0 未打印 1 打印查询条件
	 * 
	 * @return printStatusCondition 是否打印 0 未打印 1 打印查询条件
	 */
	public Condition<Boolean> getPrintStatusCondition() {
		return printStatusCondition;
	}

	/**
	 * 设置是否打印 0 未打印 1 打印查询条件
	 * 
	 * @param printStatusCondition 是否打印 0 未打印 1 打印查询条件
	 */
	public void setPrintStatusCondition(Condition<Boolean> printStatusCondition) {
		this.printStatusCondition = printStatusCondition;
	}

	/**
	 * 构造并返回最后打印时间查询条件
	 * 
	 * @return lastPrintTimeCondition 最后打印时间查询条件
	 */
	public Condition<LocalDateTime> lastPrintTime() {
		this.lastPrintTimeCondition = new Condition<>();
		return this.lastPrintTimeCondition;
	}
	
	/**
	 * 获取最后打印时间查询条件
	 * 
	 * @return lastPrintTimeCondition 最后打印时间查询条件
	 */
	public Condition<LocalDateTime> getLastPrintTimeCondition() {
		return lastPrintTimeCondition;
	}

	/**
	 * 设置最后打印时间查询条件
	 * 
	 * @param lastPrintTimeCondition 最后打印时间查询条件
	 */
	public void setLastPrintTimeCondition(Condition<LocalDateTime> lastPrintTimeCondition) {
		this.lastPrintTimeCondition = lastPrintTimeCondition;
	}

}
